@extends('admin.layouts.master')
@section('css')
<style>
    /*搜索框所在的区域*/
    .main_header{
        float: left;
        margin-top: 8px;
        width:100%;
        height: 100px;
        line-height: 100px;

    }
    .main_header_search{
        float: left;
        width: 155px;
        position: relative;
    }
    .main_header_search input{
        border-radius:6px;
        width: 180px;
        height: 40px;
        border: 0px solid;
    }
    .main_header_search input:hover{
        box-shadow: 0 8px 12px rgba(0,0,0,0.2);
    }

    .main_header_search input{
        padding-left:45px;
        font-size: 16px;
        color:#ccc;
    }
    /*================*/
    .main_header_add{
        float: right;
        width: 215px;
        height: 100px;
        line-height: 100px;
        text-align: right;

    }

    .add_box img{
        float:left;
        margin-top:6px;
        margin-left:6px;
        width: 28px;
        height: 28px;
        line-height: 40px;
    }
    .add_box span{
        float: left;
        font-size:18px;
        margin-left: 8px;
        color:  #24a7f6;
    }
    /*======主要内容区=====*/
    .main_form{
        float: left;
        width: 100%;
        height: 783px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 12px rgba(0,0,0,0.2);
    }
    .main_formlist{
        margin-top:30px;
    }

    .main_table tr{
        height: 50px;
        width: 100%;
    }
    .main_table tr th{
        text-align: center;
        line-height: 50px;
        height: 50px;
        font-size: 20px;
    }
    .main_all {
        width: 80%;
    }



    .choose_num input{
        width: 40px;
        text-align: center;
        height: 32px;
        line-height: 30px;
    }

    /*master引入后显示=====商品分类*/

    .sub_classname ul li{
        display: block;
        text-align: left;
        padding-left: 10px;
    }

</style>
@endsection
@section('content')

<div class="main_header clearfix">

    <div class="main_header_search clearfix">

    </div>

    <div class="main_header_add clearfix">



    </div>
</div>
<div class="main_form clearfix">
    <!-- 表格 -->
    <div class="main_formlist">
        <div class="main_all">
            <form id="editForm" class="addstyle">
                <input type="hidden" name="id" value="{{$data->id}}">
                <div class="form-group">
                    <label for="class_name">分类名称</label>
                    <input type="text" class="form-control" id="class_name" name="class_name" placeholder="分类名称" value="{{$data->class_name}}">
                </div>
                <div class="form-group">
                    <label for="class_name">分类代码</label>
                    <input type="text" class="form-control" name="code" placeholder="分类代码" value="{{$data->code}}">
                </div>
                <div class="form-group">
                    <label for="flast_class">上级分类</label>
                    <select name="fid" class="form-control">
                        <option value="0">顶级分类</option>
                        @include('admin.goods_class_option',['goodsClasses'=>$goodsClasses,'sign'=>'&nbsp;&nbsp;&nbsp;&nbsp;','fid'=>$data->fid])
                    </select>
                </div>
                <div class="form-group">
                    <label for="class_info">分类描述</label>
                    <textarea class="form-control" name="class_info" id="class_info" style="height: 200px;">{{$data->class_info}}</textarea>
                </div>
                <button id="save" type="button" class="btn btn-default" style="margin-left: 200px;">保存</button>
            </form>
        </div>

    </div>
    <!-- Large modal -->
{{--<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>--}}


  </div>
    @endsection
    @section('js')
    <script>
        $("#save").click(function () {
            $.ajax({
                url: '/admin/classification/editpost_class',
                dataType: 'json',
                data: $('#editForm').serialize(),
                type: 'post',
                success: function (res) {
                    if (res.status == 0) {
                        layer.msg(res.msg);
                    } else {
                        layer.msg(res.msg, {icon: 1}, function () {
                            location.href = '/admin/classification';
                        });
                    }
                }
            })
        })
    </script>
    @endsection
